﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Easy.Common;
using Easy.Operation;

namespace Easy.Web.Service.Privilege
{
    /// <summary>
    /// MigrateUserRecords 的摘要说明
    /// </summary>
    public class MigrateUserRecords : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            CustomResult cusResult = new CustomResult();
            try
            {
            string SystemUserId = context.Request["SystemUserId"];
            string ToWho = context.Request["ToWho"];
            string isMigrateUserRecords = UserPrivilege_Functions.isMigrateUserRecords(SystemUserId,ToWho);
            
            cusResult.ResultCode = (int)CustomExceptionState.SUCCESS;
            cusResult.ResultMessage = "成功";
            cusResult.ResultData = isMigrateUserRecords;
            }
            catch (CustomException ce)
            {
                cusResult = ce.CustomResult;
            }
            catch (Exception e)
            {
                cusResult.ResultCode = -1;
                cusResult.ResultMessage = e.Message;
            }
            finally
            {
                context.Response.Write(JsonConvert.SerializeObject(cusResult));
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}